import { BaseEntity } from '../../base/entity/base';
import { Column, Entity, Index } from 'typeorm';

/**
 * 气象数据记录
 */
@Entity('iot_weather_data')
export class IotWeatherDataEntity extends BaseEntity {
  @Index()
  @Column({ comment: '城市编码' })
  cityCode: string;

  @Column({ comment: '温度', type: 'decimal', precision: 5, scale: 2 })
  temperature: number;

  @Column({ comment: '湿度', type: 'decimal', precision: 5, scale: 2 })
  humidity: number;

  @Column({ comment: '天气现象' })
  weather: string;

  @Column({ comment: '采集时间' })
  collectTime: Date;
}